package com.xingzuo.library_expert.ui;

import android.os.Bundle;
import android.widget.ImageView;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.xingzuo.base.app.AppActivityKey;
import com.xingzuo.base.ui.mvp.base.ui.BaseMvpActivity;
import com.xingzuo.library_expert.R;
import com.xingzuo.library_expert.R2;
import com.xingzuo.library_expert.adapter.MyAppointmentAdapter;
import com.xingzuo.library_expert.bean.MyAppontmentBean;
import com.xingzuo.library_expert.bean.MyAppontmentChildBean;
import com.xingzuo.library_expert.contract.MyAppointmentContract;
import com.xingzuo.library_expert.presenter.MyAppointmentPresenter;


import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
@Route(path = AppActivityKey.MYAPPOINTMENTACTIVITY)
public class MyAppointmentActivity extends BaseMvpActivity<MyAppointmentPresenter> implements MyAppointmentContract.View {
    @BindView(R2.id.iv_back)
    ImageView ivBack;
    @BindView(R2.id.rv_list)
    RecyclerView rvList;
    private MyAppointmentAdapter appointmentAdapter;
    private List<MyAppontmentBean> list=new ArrayList<>();
    @Override
    public MyAppointmentPresenter getPresenter() {
        return new MyAppointmentPresenter();
    }

    @Override
    public int getView() {
        return R.layout.activity_myappointment;
    }

    @Override
    public void initView() {
        rvList.setLayoutManager(new LinearLayoutManager(this));
        appointmentAdapter=new MyAppointmentAdapter(R.layout.item_myreservation_list,list);
        rvList.setAdapter(appointmentAdapter);
    }

    @Override
    public void initLinsenterner() {

    }

    @Override
    public void getData() {
        List<MyAppontmentChildBean> myAppontmentChildBeans=new ArrayList<>();
        myAppontmentChildBeans.add(new MyAppontmentChildBean());
        myAppontmentChildBeans.add(new MyAppontmentChildBean());
        list.add(new MyAppontmentBean("4月15",myAppontmentChildBeans));
        list.add(new MyAppontmentBean("4月18",myAppontmentChildBeans));
        list.add(new MyAppontmentBean("4月10",myAppontmentChildBeans));
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick(R2.id.iv_back)
    public void onViewClicked() {
        finishActivity();
    }
}